package com.qingyun.schedule.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qingyun.schedule.entity.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "student-service", path = "/student")
public interface StudentClient {

    // 根据姓名查学生
    @GetMapping("/internal/byName")
    Student getStudentByName(@RequestParam("studentName") String studentName);

    @GetMapping("/internal/byId")
    Student queryStudentById(@RequestParam("studentId") Long studentId);

}

//    Student student = studentService.getBaseMapper()
//            .selectOne(new LambdaQueryWrapper<Student>()
//                    .eq(Student::getId, schedule.getStudentId()));
//    String studentName = student.getName();